{% extends 'PHPZendOpcacheBundle:Default:opcache_base.html.twig' %}

{% block title %}PHP ZendOpcache Dashboard - List Scripts{% endblock %}

{% block body %}
  <h1 class="title">PHP ZendOPCache - List Cached Scripts</h1>
  <p>This page lists the files currently in the opcache memory. Click 'Invalidate' to remove the cached script's data from the cache.</p>

  <table border="1px">
    {% for key, script in scripts %}
      {% if loop.index == 1 or loop.index is divisible by(15) %}
        <tr>
          <td colspan="5"><b>Script</b></td>
        </tr>
        <tr>
          <td><b>Hits</b></td>
          <td><b>Memory Consumption</b></td>
          <td><b>Last Used</b></td>
          <td><b>Timestamp</b></td>
          <td><b>Purge Script</b></td>
        </tr>
      {% endif %}
      <tr>
        <td colspan="5">{{ script['full_path']|e }}</td>
      </tr>
      <tr>
        <td>{{ script.hits }}</td>
        <td>{{ script.memory_consumption }}KB</td>
        <td>{{ script.last_used }}</td>
        <td>{{ script.timestamp }}</td>
        <td><a href="{{ path('php_zend_opcache_invalidate_script', { 'file_inode':script.file_inode }) }}">Invalidate</a></td>
      </tr>
    {% endfor %}
  </table>
{% endblock %}
